package com.wisdom.benefit.jufa.net;

import com.wisdom.benefit.jufa.product.AccountSettingBean;
import com.wisdom.benefit.jufa.product.AlipayTranAccSaveBean;
import com.wisdom.benefit.jufa.main.HomeBean;
import com.wisdom.benefit.jufa.news.QueryPayeeAgentBean;
import com.wisdom.benefit.jufa.news.QueryUserOrderPayIncomeDataBean;
import com.wisdom.benefit.jufa.news.QueryUserOrderPayListBean;
import com.wisdom.benefit.jufa.my.UserImfoBean;
import com.wisdom.benefit.jufa.my.UserPassagewayListBean;
import com.wisdom.benefit.jufa.bean.HomeListBean;
import com.wisdom.benefit.jufa.bean.UpdateAppBean;

import com.wisdom.benefit.jufa.entity.CommonNewResponse;
import com.wisdom.benefit.jufa.entity.CommonResponse;
import com.wisdom.benefit.jufa.entity.TestBean;

import java.util.ArrayList;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface ApiService {










    //  修改密码
    @FormUrlEncoded
    @POST("/app/changePassword")
    Observable<CommonNewResponse<Object>> changePassword(@Field("userId") String userId,
                                                         @Field("newPassword") String newPassword,
                                                         @Field("oldPassword") String oldPassword,
                                                         @Field("deviceId") String deviceId);

    //  退出
    @FormUrlEncoded
    @POST("/app/logout")
    Observable<CommonNewResponse<Object>> logout(@Field("userId") String userId);

    //  是否进入排队
    @FormUrlEncoded
    @POST("/app/updateStatus")
    Observable<CommonNewResponse<Object>> updateStatus(@Field("userId") String userId,
                                                       @Field("status") String status,
                                                       @Field("deviceId") String deviceId);

    //  支付宝自动转账链接
    @FormUrlEncoded
    @POST("alipay/open")
    Observable<CommonNewResponse<TestBean>> alpay(@Field("userId") String userId);

    //  当前使用通道列表
    @FormUrlEncoded
    @POST("/app/userPassagewayList")
    Observable<CommonNewResponse<ArrayList<HomeListBean>>> userPassageway(@Field("userId") Long userIdCreate);

    //  app更新接口
    @POST("/app/appUpdate")
    Observable<CommonNewResponse<UpdateAppBean>> appUpdate();

    //  关闭/开启当前通道
    @FormUrlEncoded
    @POST("/app/editPassagewayStatus")
    Observable<CommonNewResponse<Object>> editPassagewayStatus(@Field("userId") Long userId,
                                                               @Field("passagewayId") Long passagewayId,
                                                               @Field("status") int status);

    // 接单状态接口
    @FormUrlEncoded
    @POST("/app/receiptState")
    Observable<CommonNewResponse<Object>> receiptState(@Field("userId") String userId);

    //  新增账户通道
    @FormUrlEncoded
    @POST("/app/passagewaySave")
    Observable<CommonNewResponse<Object>> passagewaySave(@Field("userId") Long userId,
                                                         @Field("passagewayType") int passagewayType,
                                                         @Field("passagewayName") String passagewayName,
                                                         @Field("area") String area);

    //  修改收款码状态
    @FormUrlEncoded
    @POST("/app/editPaymentCodeRecAcc")
    Observable<CommonNewResponse<Object>> editPaymentCodeRecAcc(@Field("userIdCreate") Long userIdCreate,
                                                                @Field("codeId") Long codeId,
                                                                @Field("receivingAccount") int receivingAccount,
                                                                @Field("belongPassageway") Long belongPassageway);

    //  支付宝转账新增（授权）接口
    @FormUrlEncoded
    @POST("/app/alipayTranAccSave")
    Observable<CommonNewResponse<AlipayTranAccSaveBean>> alipayTranAccSave(@Field("userIdCreate") Long userIdCreate,
                                                                           @Field("belongPassageway") Long belongPassageway);


    //  订单收入情况
    @FormUrlEncoded
    @POST("/app/queryUserOrderPayIncomeData")
    Observable<CommonNewResponse<QueryUserOrderPayIncomeDataBean>> queryUserOrderPayIncomeData(@Field("payeeId") Long payeeId);


    //  确认收款
    @FormUrlEncoded
    @POST("/app/confirmReceipt")
    Observable<CommonNewResponse<Object>> confirmReceipt(@Field("id") Long id);

    //  余额明细查询
    @FormUrlEncoded
    @POST("/app/detailsOfBalance")
    Observable<CommonNewResponse<ArrayList<UserPassagewayListBean>>> userPassagewayList(@Field("userId") Long userId,
                                                                                        @Field("startTime") String startTime,
                                                                                        @Field("endTime") String endTime);


    //  订单按条件查询接口
    @FormUrlEncoded
    @POST("/app/queryUserOrderPayList")
    Observable<CommonNewResponse<ArrayList<QueryUserOrderPayListBean>>> queryUserOrderPayList(@Field("payeeId") Long payeeId,
                                                                                              @Field("orderId") String orderId,
                                                                                              @Field("orderNo") String orderNo,
                                                                                              @Field("actualMoney") double actualMoney,
                                                                                              @Field("payType") int payType,
                                                                                              @Field("status") int status,
                                                                                              @Field("startTime") String startTime,
                                                                                              @Field("endTime") String endTime,
                                                                                              @Field("deviceId") String deviceId,
                                                                                              @Field("offset") int offset,
                                                                                              @Field("limit") int limit);


    //  上传凭证点击查询接口
    @FormUrlEncoded
    @POST("/app/queryPayeeAgentBankByPayeeId")
    Observable<CommonNewResponse<QueryPayeeAgentBean>> queryPayeeAgentBankByPayeeId(@Field("userId") Long userId);

    //  上传凭证接口
    @FormUrlEncoded
    @POST("/app/uploadReceipt")
    Observable<CommonNewResponse<Object>> uploadReceipt(@Field("orderId") String orderId,
                                                        @Field("payeeId") Long payeeId,
                                                        @Field("voucher") String voucher,
                                                        @Field("voucherType") String voucherType);


    //  删除收款码
    @FormUrlEncoded
    @POST("/app/paymentCodeDelete")
    Observable<CommonNewResponse<Object>> paymentCodeDelete(@Field("userIdCreate") Long userIdCreate,
                                                            @Field("codeId") Long codeId,
                                                            @Field("belongPassageway") Long belongPassageway);

    //  删除账户通道
    @FormUrlEncoded
    @POST("/app/passagewayDelete")
    Observable<CommonNewResponse<Object>> passagewayDelete(@Field("passagewayId") Long passagewayId);

    //  收款码列表
    @FormUrlEncoded
    @POST("/app/userPassagewayCodeList")
    Observable<CommonNewResponse<ArrayList<AccountSettingBean>>> userPassagewayCodeList(@Field("userIdCreate") Long userIdCreate,
                                                                                        @Field("belongPassageway") Long belongPassageway);

    // 新增收款码
    @FormUrlEncoded
    @POST("/app/paymentCodeSave")
    Observable<CommonNewResponse<Object>> paymentCodeSave(@Field("userIdCreate") Long userIdCreate,
                                                          @Field("passagewayId") int passagewayId,
                                                          @Field("payeeName") String payeeName,
                                                          @Field("accountNumber") String accountNumber,
                                                          @Field("dailyCollectionTimes") int dailyCollectionTimes,
                                                          @Field("qrCode") String qrCode,
                                                          @Field("qrCodeType") String qrCodeType,
                                                          @Field("belongPassageway") Long belongPassageway,
                                                          @Field("qrCodeRealName") String qrCodeRealName,
                                                          @Field("payAccountPassword") String payAccountPassword
    );



    //  根据订单号查询该用户下单时的所属的收代
    @FormUrlEncoded
    @POST(RetrofitService.BASE_URL_DIR + "/app/queryPayeeAgentBankByOrderId")
    Observable<CommonResponse<Object>> queryPayeeAgentBankByOrderId(@Field("token") String token);
    //  个人信息
    @FormUrlEncoded
    @POST("/app/personalInformation")
    Observable<CommonNewResponse<UserImfoBean>> personalInformation(@Field("userId") String userId);

    //  登录
    @FormUrlEncoded
    @POST("/app/login")
    Observable<CommonNewResponse<Object>> login(@Field("userName") String userName,
                                                @Field("password") String password,
                                                @Field("deviceId") String deviceId);

    //  首页余额
    @FormUrlEncoded
    @POST("/app/findUser")
    Observable<CommonNewResponse<HomeBean>> findUser(@Field("userId") String userId);
}
